package com.example.controller;

import com.example.domain.ResponseResult;
import com.example.entity.SysUser;
import com.example.service.LoginService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author: 21050134
 * @date: 2023/11/8 17:17
 * @description:
 */
@RestController
public class LoginController {

	@Autowired
	private LoginService loginService;


	@PostMapping("/user/login")
	public ResponseResult login(@RequestBody SysUser user){
		return loginService.login(user);
	}


	@PostMapping("/user/logout")
	public ResponseResult logout(){
		return loginService.logout();

	}

}
